﻿using System;

namespace Entities
{
    [Serializable]
    public class tblManufacturer
    {
        private string name;
        private string image;

        public tblManufacturer() {}

        public tblManufacturer(string name, string image)
        {
            this.name = name;
            this.image = image;
        }

        public string Name
        {
            get { return this.name; }
            set
            {
                if (value == null)
                    throw new Exception("Tên nhà sản xuất không được để trống!");
                this.name = value;
            }
        }

        public string Image
        {
            get { return this.image; }
            set
            {
                this.image = value;
            }
        }

        public override string ToString()
        {
	        return this.name+"; "+this.image+"; ";
	    }
	    public override bool Equals(Object obj)
	    {
            tblManufacturer me = (tblManufacturer)obj;
	        bool ret=this.Name.Equals(me.Name);
	        return ret;
	    }
	    public override int GetHashCode()
	    {
	        return this.Name.GetHashCode();
	    }

    }
}
